home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / faq / kjvcbibl.lha / cbible / rexx / changeall.thnkr < prev    next >
Text File  |  1991-12-05  |  779b  |  26 lines

  1. /******************************************************************
  2. *                                                                 *
  3. *  Macro to change all occurrences of a string to a second string *
  4. *                                                                 *
  5. ******************************************************************/
  6. trace off
  7. options results
  8. parse arg source destination .
  9. if source = '' then do
  10.    'input Enter search string'
  11.    source=result
  12. end
  13. if result = '' then exit 1 /* changes mind */
  14. if destination = '' then do
  15.    'input Enter replacement string'
  16.    destination=result
  17. end
  18. 'search first' source
  19. if rc = 0 then do
  20.    'search replace' destination
  21.    do while rc=0
  22.        'search next'
  23.        if rc=0 then 'search replace' destination
  24.    end
  25.  end
  26.